import React from "react";

import '../../Style/fund.css';
import {Icon, NavBar} from "antd-mobile";
import { List, InputItem } from 'antd-mobile';
import { Button } from 'antd-mobile';

const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps;
if (isIPhone) {
    moneyKeyboardWrapProps = {
        onTouchStart: e => e.preventDefault(),
    };
};

export default class Fund_simulation_buy extends React.Component{

    state = {
        type: 'money',
    };
    render() {
        const { type } = this.state;
        return(
            <div>
                <NavBar className="f_r_nav"
                        mode="light"
                        leftContent={[
                            <Icon type="left" />,
                            "返回",
                        ]}
                        onLeftClick={() => {this.props.history.push('/terran/fundinfo')}}
                >
                    买入
                </NavBar>
                <div style={{width:'100%',height:'10px',marginTop:'50px',background:'rgb(245,245,247)'}}></div>
                <div style={{width:'100%',height:'40px',lineHeight:'40px',fontSize:'18px',margin:'0',padding:'0 0 0 20px'}}
                     onClick={() => {
                         window.location.href = '#/terran/fundbuy'
                     }}>基金名称</div>
                <div style={{width:'100%',height:'10px',background:'rgb(245,245,247)'}}></div>
                <div style={{width:'100%',margin:'0',padding:'0 0 0 20px'}}>
                    <p style={{width:'100%',height:'40px',lineHeight:'40px',fontSize:'18px',margin:'0',padding:'0'}}>买入金额</p>
                    <InputItem
                        type={type}
                        placeholder="请输入买入金额"
                        clear
                        moneyKeyboardAlign="left"
                        moneyKeyboardWrapProps={moneyKeyboardWrapProps}
                        className="input_buy_money">￥</InputItem>
                </div>
                <div style={{width:'100%',height:'10px',background:'rgb(245,245,247)'}}></div>
                <div style={{width:'100%',height:'50px',lineHeight:'50px',fontSize:'18px',margin:'0',padding:'0 20px 0 20px'}}>
                    <div style={{height:'100%',margin:'0',padding:'0',float:'left'}}>付款方式</div>
                    <div style={{height:'100%',margin:'0',padding:'0',float:'right',zIndex:'1000'}}
                         onClick={() => {
                             window.location.href = '#/terran/fundbuy'
                         }}>模拟交易金</div>
                </div>
                <div style={{width:'100%',height:'15px',background:'rgb(245,245,247)'}}></div>
                <Button type={"primary"} className="botton_buy_fund"
                        onClick={() => {
                            window.location.href = '#/terran/fundbuypass'
                        }}>
                    <p>确定</p>
                </Button>
            </div>
        )
    }
}